<?php

class Friend_Search_Lucene_Document extends Zend_Search_Lucene_Document {
	
	const DOCREF = 'docRef';
	const CLASS_NAME = 'class';
	const KEY = 'key';
	const USERNAME = 'username';
	const EMAIL = 'email';
	
	/**
	 * Constructor.
	 * 
	 * @param $class
	 * @param $id
	 * @param $username
	 * @param $email
	 */
	public function __construct($class, $id, $username, $email) {
		$this->addField(Zend_Search_Lucene_Field::Text(self::DOCREF, $class.':'.$id, 'UTF-8'));
		$this->addField(Zend_Search_Lucene_Field::Text(self::CLASS_NAME, $class, 'UTF-8'));
		$this->addField(Zend_Search_Lucene_Field::Text(self::KEY, $id, 'UTF-8'));
		$this->addField(Zend_Search_Lucene_Field::Text(self::USERNAME, $username, 'UTF-8'));
		$this->addField(Zend_Search_Lucene_Field::Text(self::EMAIL, $email, 'UTF-8'));
	}
}
?>